package com.adp.interceptor;

import com.adf.config.component.application.report.ReportBean;
import com.adf.system.ReportRequest;
import com.adf.system.component.application.report.abstractreport.AbsReportType;
import com.adf.system.intercept.AbsInterceptorDefaultAdapter;
import com.adf.system.intercept.RowDataBean;

public class rowbgcolorTelinfo extends AbsInterceptorDefaultAdapter
{

    public void beforeDisplayReportDataPerRow(ReportRequest rrequest, ReportBean rbean, RowDataBean rowDataBean)
    {
        if(rowDataBean.getRowindex()<0)
        {//当前是在显示标题行
            return;
        }
        AbsReportType reportTypeObj=rrequest.getDisplayReportTypeObj(rbean.getId());
        if(reportTypeObj.getLstReportData()!=null&&rowDataBean.getRowindex()<reportTypeObj.getLstReportData().size())
        {	
        	String strState = rowDataBean.getColData("STATE").toString();
        	String styleproperty=rowDataBean.getRowstyleproperty();
        	if(styleproperty==null) styleproperty="";
        	
            if("办结".equals(strState))
            {
                styleproperty+=" style='background:#3CB371'";
            }else if("待签收".equals(strState)){
                styleproperty+=" style='background:#FF6347'";
            }else{
                styleproperty+=" style='background:#FFFF00'";
            }
            rowDataBean.setRowstyleproperty(styleproperty);
        }
    }
}
